
package gxwl.relation.service;


import com.baomidou.mybatisplus.extension.service.IService;
import gxwl.relation.entity.SysRelation;

import java.util.List;

/**
 * 关系Service接口
 *
 * @author baijhc
 * @date 2023/4/21 18:35
 **/
public interface SysRelationService extends IService<SysRelation> {
    /**
     * @description: 根据对象id和关系分类获取目标id列表
     *
     * @author: baijhc
     * @date: 2024/3/21 14:13
     * @param: objectId
     * @param: category
     * @return String
     **/
    List<String> getRelationTargetIdListByObjectIdAndCategory(String objectId, String category);

    /**
     * 根据对象id和关系分类获取关系列表
     *
     * @author baijhc
     * @date 2023/4/27 22:06
     */
    List<SysRelation> getRelationListByObjectIdAndCategory(String objectId, String category);
    /**
     * @description: 清空原关系并批量保存关系
     *
     * @author: baijhc
     * @date: 2024/3/21 14:29
     * @param: objectId
     * @param: targetIdList
     * @param: category
     **/
    void saveRelationBatchWithClear(String objectId, List<String> targetIdList, String category);

    void saveRelationBatchWithClear(String objectId, List<String> targetIdList, String category, List<String> extJsonList);

    /**
     * 根据目标id和关系分类获取对象id列表
     *
     * @author xuyuxiang
     * @date 2022/4/27 22:08
     */
    List<String> getRelationObjectIdListByTargetIdAndCategory(String targetId, String category);

    List<SysRelation> getRelationListByTargetIdAndCategory(String targetId, String category);
}
